<!DOCTYPE html>
<html lang="zh-CN"  xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>添加博客</title>
    <link rel="stylesheet" href="/security/static/layui/css/layui.css" media="all" />
    <script type="text/javascript" src="/security/static/layui/layui.js"></script>
    <script type="text/javascript" src="/security/static/js/imageUpload.js"></script>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>
<body>
<div class="container">
    <h1>添加博客</h1>
    <hr/>
    <form th:action="@{/addBlog}" method="post" role="form">
        <div class="form-group">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>标题</legend>
            </fieldset>
            <input type="text" class="form-control" id="title" name="title" placeholder="Enter Title:"/>
        </div>
        <div class="form-group">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>作者</legend>
            </fieldset>
            <select  class="form-control" id="author" name="author">
                <option th:each="user,userStat:${users}" th:value="${user.getUsername()}" th:text="${user.getUsername()}" ></option>
            </select>
        </div>
        <div class="form-group">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>正文</legend>
        </fieldset>
            <textarea class="form-control" id="content" name="content" rows="3" placeholder="Please Input Content"></textarea>
        </div>
        <div class="form-group">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>图片上传</legend>
            </fieldset>
            <div class="layui-upload-drag">
                <input type="hidden" id="articleImgUrl" name="articleImgUrl" >
                <div class="layui-upload-list">
                    <img class="layui-upload-img"  id="uploadimg" src="http://xn--r8s0d654n.online:8080/images/d72aafe6-0229-4c5f-b49f-6d71c84c0a3e.png">
                </div>
            </div>
        </div>
        <div class="form-group">
            <button type="submit" class="btn btn-sm btn-success">提交</button>
        </div>
    </form>
</div>

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>